/*
 * @Author: darkgoldenrod(暮秋)
 * @Date: 2022-03-31 09:01:58
 * @LastEditTime: 2022-04-26 11:16:54
 * @LastEditors: darkgoldenrod(暮秋)
 * @Description: 
 * @FilePath: \vue_咸鱼\spuertalkl\src\router\index.js
 */
import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import Login from "../views/login/login.vue"

Vue.use(VueRouter)

const routes = [
  {
    path: "/",
    redirect: "/home"
  },
  {
    path: '/home',
    name: 'Home',
    component: Home,
    children: [
      {
        path: "crawl",
        name: "crawl",
        component: () => import("../views/datacrawl/crawl.vue"),
        meta: {
          title: "数据爬取",
          isShow: true
        }
      },
      {
        path: "exportdata",
        name: "exportdata",
        component: () => import("../views/datacrawl/exportdata.vue"),
        meta: {
          title: "数据查询",
          isShow: true
        }
      },
      {
        path: "user",
        name: "user",
        component: () => import("../views/user/user.vue"),
        meta: {
          title: "用户管理",
          isShow: true
        }
      },
      {
        path: "role",
        name: "role",
        component: () => import("../views/user/role.vue"),
        meta: {
          title: "角色管理",
          isShow: true
        }
      },
      {
        path: "supertopic",
        name: "supertopic",
        component: () => import("../views/dataShow/supertopic.vue"),
        meta: {
          title: "超话数据分析",
          isShow: true
        }
      },
      {
        path: "person",
        name: "person",
        component: () => import("../views/dataShow/person.vue"),
        meta: {
          title: "个人数据分析",
          isShow: true
        }
      },
      {
        path: "weibomanger",
        name: "weibomanger",
        component: () => import("../views/weiboManager/weibomanger.vue"),
        meta: {
          title: "微博管理",
          isShow: true
        }
      },
    ]
  },
  {
    path: "/login",
    name: "login",
    component: Login
  }
]

const router = new VueRouter({
  routes
})

export function restRouter(){
  const newrouter = new VueRouter({
    routes
  })
  router.matcher = newrouter.matcher
}

export default router
